package a.f.h.b;

import a.a.qb;
import a.c.ab;
import a.c.q;
import a.f.dc;
import a.f.h.a.b.p;
import a.f.j.cb;
import a.f.oc;
import a.f.wc;
import a.i.db;

public class a
  extends a.f.mb
{
  protected cb w = null;
  protected boolean x = false;
  protected boolean y = false;
  protected boolean z = true;
  protected boolean A = false;
  protected boolean B = false;
  protected int C;
  protected a.f.j.m D;
  protected b E;
  protected l F;
  protected d G;
  protected e H;
  protected a.f.t I = null;
  private a.f.h.a.b.b J;
  private i K = null;
  private a.i.mb L = new a.i.mb();
  private a.f.h.k M = new a.f.h.k();
  public static boolean N;
  
  public a()
  {
    f(false);
    b(false);
    this.I = new a.f.t();
    g(this.I);
    e(true);
    this.H = new e();
    c(false);
  }
  
  public void a(a.f.h.k paramk)
  {
    this.M = paramk;
  }
  
  public void a(cb paramcb)
  {
    this.w = paramcb;
  }
  
  public void a(a.f.h.a.b.b paramb)
  {
    this.J = paramb;
  }
  
  public int a()
  {
    return this.C;
  }
  
  public void a(int paramInt)
  {
    this.I.a(paramInt);
    this.C = paramInt;
  }
  
  public boolean s()
  {
    return this.y;
  }
  
  public void h(boolean paramBoolean)
  {
    this.y = paramBoolean;
  }
  
  public boolean t()
  {
    return this.z;
  }
  
  public void i(boolean paramBoolean)
  {
    this.z = paramBoolean;
  }
  
  public boolean u()
  {
    return this.A;
  }
  
  public void j(boolean paramBoolean)
  {
    this.A = paramBoolean;
  }
  
  public boolean v()
  {
    return this.B;
  }
  
  public void k(boolean paramBoolean)
  {
    this.B = paramBoolean;
  }
  
  public void l(boolean paramBoolean)
  {
    this.x = true;
  }
  
  public void a(a.f.j.m paramm)
  {
    this.D = paramm;
  }
  
  public a.f.j.m w()
  {
    return this.D;
  }
  
  public void a(b paramb)
  {
    this.E = paramb;
  }
  
  public b x()
  {
    return this.E;
  }
  
  public void a(l paraml)
  {
    this.F = paraml;
  }
  
  public l y()
  {
    return this.F;
  }
  
  public d z()
  {
    return this.G;
  }
  
  public void a(d paramd)
  {
    this.G = paramd;
  }
  
  public e A()
  {
    return this.H;
  }
  
  public void a(e parame)
  {
    this.H = parame;
  }
  
  public i B()
  {
    return this.K;
  }
  
  public boolean b(a.f.o paramo)
  {
    return true;
  }
  
  private boolean C()
  {
    int i = f.m;
    boolean bool = false;
    if (i == 0) {
      if ((y() instanceof a.f.h.d.o))
      {
        a.f.h.d.o localo = (a.f.h.d.o)y();
        if (i != 0) {
          break label42;
        }
        if (localo.c() == 0) {
          bool = true;
        }
      }
    }
    label42:
    return bool;
  }
  
  protected void a(dc paramdc, Object paramObject)
    throws IllegalArgumentException
  {}
  
  protected void b(dc paramdc, Object paramObject)
    throws IllegalArgumentException
  {}
  
  private a.f.h.k a(a.c.d paramd, f paramf)
  {
    int i = f.m;
    cb localcb = (cb)paramf.b();
    if (i == 0) {}
    a.c.d locald = localcb.h(paramd) ? localcb.n(localcb.b(paramd)) : localcb.n(paramd);
    if (((i != 0) || (locald != null)) && ((i != 0) || (paramd.c() != null)))
    {
      a.c.k localk = paramd.c().c(j.y);
      if (((i != 0) || (localk != null)) && ((i != 0) || (localk.get(locald) != null))) {
        return (a.f.h.k)localk.get(locald);
      }
    }
    return this.M;
  }
  
  public void a(a.f.o paramo)
  {
    int i3 = f.m;
    boolean bool3 = f.l;
    a.i.n.a(this, 1, "---->> Starting Layout algorithm:");
    this.K = new i();
    a.i.mb localmb = new a.i.mb();
    a(paramo);
    if ((i3 != 0) || (paramo.m() == 0))
    {
      paramo.a(paramo.v().d(), 0.0D, 0.0D);
      return;
    }
    ab localab = new ab(paramo.w());
    f localf = null;
    cb localcb = (i3 != 0) || (this.x) ? this.w : new cb(paramo);
    a.f.h.d.t localt = new a.f.h.d.t();
    if (i3 == 0) {
      if (v())
      {
        if (i3 != 0) {
          break label160;
        }
        if (C()) {
          localt.a(paramo, this.C);
        }
      }
    }
    if (u())
    {
      label160:
      localObject1 = paramo.c(oc.a);
      if (i3 != 0) {
        break label202;
      }
      if (localObject1 != null) {
        this.H.a(localcb, (a.c.k)localObject1, this.C);
      }
    }
    qb.a("before phase 1");
    label202:
    Object localObject1 = new c();
    g localg = new g();
    localg.a(this.C);
    if (i3 == 0)
    {
      if (!this.x)
      {
        if (i3 == 0) {
          if (this.z) {
            ((c)localObject1).a(paramo);
          }
        }
        if (i3 == 0)
        {
          if (this.y) {
            localg.a(paramo);
          }
          this.L.g();
          this.D.a(localcb);
          if (i3 != 0) {}
        }
        else
        {
          if (paramo.m() != 0) {
            this.D.a();
          }
          this.K.b = ((int)this.L.d());
          this.K.p = localcb.n();
        }
        a(paramo);
      }
      qb.a("before phase 2");
    }
    if (i3 == 0)
    {
      if (this.G != null)
      {
        this.G.a(this.C);
        this.G.a(localcb);
        this.G.a();
      }
    }
    else
    {
      localcb = this.G.b();
      if ((this.H instanceof p))
      {
        localObject2 = paramo.c(oc.a);
        if (localObject2 != null) {
          ((p)this.H).a(this.J, localcb, (a.c.k)localObject2, localab);
        }
      }
      localf = new f(localcb);
      break label478;
    }
    localf = new f(localcb);
    label478:
    this.L.g();
    this.E.a(localf);
    if (i3 == 0)
    {
      if (localf.a().m() != 0) {
        this.E.a();
      }
      this.K.f = ((int)this.L.d());
      if (i3 != 0) {}
    }
    else
    {
      if (!this.x)
      {
        if (i3 == 0)
        {
          if (this.y)
          {
            localg.a(localf);
            localg.a();
          }
          if (i3 != 0) {
            break label613;
          }
        }
        if (this.z)
        {
          ((c)localObject1).a(localf);
          ((c)localObject1).a();
        }
      }
      this.K.q = this.E.b();
    }
    label613:
    a(paramo);
    qb.a("before phase 3");
    Object localObject2 = localf.a().u();
    int i = 0;
    do
    {
      if (i >= localObject2.length) {
        break;
      }
      localObject3 = localObject2[i];
      if (bool3) {
        break label687;
      }
      if (i3 == 0)
      {
        if (!localf.d((a.c.d)localObject3)) {
          localf.o((a.c.d)localObject3);
        }
        i++;
      }
    } while (!bool3);
    label687:
    a.f.o localo = (a.f.o)localf.a();
    Object localObject3 = db.b();
    Object localObject4 = localo.w();
    a.c.d locald;
    a.f.h.k localk;
    do
    {
      if (!((a.c.m)localObject4).e()) {
        break;
      }
      locald = ((a.c.m)localObject4).a();
      if (bool3) {
        break label796;
      }
      if (!localf.d(locald))
      {
        localk = a(locald, localf);
        if (i3 != 0) {
          continue;
        }
        if (localk != null) {
          ((a.c.n)localObject3).a(locald, localk.d());
        }
      }
      ((a.c.m)localObject4).f();
    } while (!bool3);
    if (i3 == 0)
    {
      if (u())
      {
        label796:
        this.H.a((a.c.n)localObject3);
        this.H.a(localf);
        this.H.b();
      }
      localObject4 = localo.w();
      label1079:
      label1115:
      label1139:
      label1148:
      do
      {
        if (!((a.c.m)localObject4).e()) {
          break;
        }
        locald = ((a.c.m)localObject4).a();
        if (bool3) {
          break label1255;
        }
        if (!localf.d(locald))
        {
          localk = (a.f.h.k)((a.c.n)localObject3).get(locald);
          if (i3 != 0) {
            continue;
          }
          if (localk != null)
          {
            int j = a(locald, localo, localf);
            int k = (int)Math.ceil((j + localk.c()) / this.C);
            int m = (int)Math.ceil((j + localk.a()) / this.C);
            int n = (int)Math.ceil((j + localk.b()) / this.C);
            int i1 = (int)Math.ceil((j + localk.b() + localk.a()) / this.C);
            int i2 = Math.max(k, localf.j(locald));
            boolean bool1 = a(locald.e(), localf);
            boolean bool2 = a(locald.f(), localf);
            if (i3 == 0) {
              if (bool1)
              {
                if (i3 != 0) {
                  break label1079;
                }
                if (bool2)
                {
                  if (i3 != 0) {
                    break label1079;
                  }
                  if (i2 < i1)
                  {
                    i2 = i1;
                    if (i3 != 0) {
                      break label1148;
                    }
                    if (!bool3) {
                      break label1139;
                    }
                  }
                }
              }
            }
            if (i3 == 0) {
              if (bool1)
              {
                if (i3 != 0) {
                  break label1115;
                }
                if (i2 < m)
                {
                  i2 = m;
                  if (i3 != 0) {
                    break label1148;
                  }
                  if (!bool3) {
                    break label1139;
                  }
                }
              }
            }
            if (((i3 != 0) || (bool2)) && ((i3 != 0) || (i2 < n))) {
              i2 = n;
            }
            localf.c(locald, i2);
            localf.c(localf.a(locald), i2);
          }
        }
        ((a.c.m)localObject4).f();
      } while (!bool3);
      this.L.g();
      wc.a(paramo);
      this.F.a(this.C);
      this.F.a(localf);
      this.F.a(this.K);
      this.F.a();
      this.K.g = ((int)this.L.d());
      if (i3 != 0) {}
    }
    else if (u())
    {
      label1255:
      this.H.a(localt);
      localf.m();
      this.H.c();
    }
    if (i3 == 0) {
      if (this.G != null) {
        this.G.c();
      }
    }
    if (i3 == 0) {
      if (this.A) {
        this.H.a();
      }
    }
    if (i3 == 0) {
      if (this.x) {
        localf.n();
      }
    }
    if (i3 == 0)
    {
      if (!this.x) {
        this.D.b();
      }
      localf.v();
      a(paramo);
    }
    if (i3 == 0)
    {
      if (v()) {
        localt.a();
      }
      if (i3 != 0) {}
    }
    else
    {
      if ((this.D instanceof a.f.j.f))
      {
        localObject4 = (a.f.j.f)this.D;
        this.K.c = ((a.f.j.f)localObject4).i();
        this.K.d = ((a.f.j.f)localObject4).j();
        this.K.e = ((a.f.j.f)localObject4).k();
      }
      this.K.a = ((int)localmb.d());
      a.i.n.a(this, 1, "---> Total running time of the algorithm: " + localmb);
    }
    a.i.n.a(this, 1, "<<---- Leaving algorithm");
  }
  
  private boolean a(a.c.e parame, f paramf)
  {
    int i = f.m;
    if (i == 0) {
      if (paramf.d(parame)) {
        return true;
      }
    }
    if (i == 0) {
      if ((w() instanceof a.f.h.a.b.i)) {
        return ((a.f.h.a.b.i)w()).c().h(parame);
      }
    }
    return false;
  }
  
  private int a(a.c.d paramd, a.f.o paramo, f paramf)
  {
    int k = f.m;
    boolean bool = f.l;
    int i = 0;
    a.c.m localm;
    a.c.d locald;
    a.c.e locale;
    k localk;
    label130:
    int j;
    if (k == 0)
    {
      if (paramf.h(paramd.e()))
      {
        localm = paramd.e().n();
        do
        {
          if (!localm.e()) {
            break;
          }
          locald = localm.a();
          locale = locald.f();
          if (bool) {
            break label242;
          }
          if (locald != paramd)
          {
            if (k != 0) {
              continue;
            }
            if (paramf.d(locale))
            {
              localk = paramf.i(locald);
              if (k == 0) {
                if (!k.a.c(localk)) {
                  if (k != 0) {
                    break label130;
                  }
                }
              }
              j = k.c.c(localk) ? 1 : 0;
              i = (int)(i + (j != 0 ? paramo.s(locale) * 0.5D : paramo.t(locale) * 0.5D));
            }
          }
          localm.f();
        } while (!bool);
      }
      if (k != 0) {}
    }
    else if (k == 0)
    {
      label300:
      if (paramf.h(paramd.f()))
      {
        localm = paramd.f().m();
        label242:
        do
        {
          if (!localm.e()) {
            break;
          }
          locald = localm.a();
          locale = locald.e();
          if (locald != paramd)
          {
            if (k != 0) {
              continue;
            }
            if (paramf.d(locale))
            {
              localk = paramf.i(locald);
              if (k == 0) {
                if (!k.a.c(localk)) {
                  if (k != 0) {
                    break label300;
                  }
                }
              }
              j = k.c.c(localk) ? 1 : 0;
              i = (int)(i + (j != 0 ? paramo.s(locale) * 0.5D : paramo.t(locale) * 0.5D));
            }
          }
          localm.f();
        } while (!bool);
      }
    }
    return i;
  }
  
  private void a(q paramq)
  {
    a.i.n.a(this, "Node Map Count: " + paramq.D().length);
    a.i.n.a(this, "Edge Map Count: " + paramq.F().length);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.b.a

 * JD-Core Version:    0.7.0.1

 */